export default {
	addToCart(context,payload) {
		return new Promise((resolve, reject) => {
			let oldProduct = context.state.cartGoods.find(item => item.iid == payload.iid)
			if(oldProduct){
				context.commit('productCountIncre',oldProduct)
				resolve('商品+1')
			}else{
				context.commit('addToCart',payload)
				resolve('商品添加成功')
			}
		})
		
	}
}